Skip to main content

Get Attribute

AutomatR.Web.GetAttribute

The "Get Attribute" activity in AutomatR's Web Activities category retrieves the value of a specified attribute of a UI element on a web page. This activity is useful when you need to capture information such as the text, href, or other attributes of a particular web element during automation.

Properties

NameDescription
Input
AttributeEnter the name of the attribute for which you want to retrieve the value. String variables containing the attribute name.
Web SelectorSelect the web element to indicate the element on the web using the selector window. Only one of "Web Selector" or "Web Element" should be provided.
Web ElementEnter UI Element variable identified by Find Element or another activity. Only one of "Web Selector" or "Web Element" should be provided.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. String variables containing the desired display name.
Optional
TimeoutEnter the time in seconds (e.g., 5 seconds) for the activity to be executed before throwing an exception. Default timeout is used if not specified.
DelayEnter the wait time in seconds (e.g., 5 seconds) before starting the activity. Useful for handling synchronization issues.
Output
ResultReturns the value of the specified attribute as a string. Variable of type string to store the attribute value.

How to use:

  1. Drag and drop the "Get Attribute" activity onto the workflow.
  2. Choose either the "Web Selector" or "Web Element" property to indicate the web element for which you want to retrieve the attribute value.
  3. Specify the name of the attribute you want to retrieve using the "Attribute" property.
  4. Optionally, configure the "Timeout" and "Delay" properties based on your requirements.
  5. Execute the workflow to retrieve the value of the specified attribute.

Example: Consider an example where the "Get Attribute" activity is used to retrieve the "href" attribute value of a link on a web page:

Get Attribute:
Web Selector: <your_selector_here>
Attribute: "href"
Timeout: 10
Delay: 2
Result: linkHref

In this example, the activity fetches the "href" attribute value of the specified web element, and the result is stored in the variable "linkHref" for further use in the workflow.